<table width="100%" border="0" cellpadding="0" cellspacing="1" class="STYLE1" bgcolor="b5d6e6">
  <tr>
    <td colspan="3" align="left" background='<%=$urr+"skin/images/bg.gif"%>'><img src='<%=$urr+"skin/icon/web_icon_015.gif"%>' width="16" height="16" />
      <span class="STYLE3"><%=@titles %></span></td>
  </tr>
</table>
<fieldset>
  <% form_for :resource, @resource, :url => { :action => "update" } do |f|  %>   
    <%= hidden_field :resource, :id %>
    <input type="hidden" id="pages" name="pages[page]" value=<%=@page%> />
    <p>
      <%= f.label :name,"资源名称" %><br />
      <%= f.text_field :name %>
    </p>

    <p>
      <%= f.label :orders,"顺序" %><br />
      <%= f.text_field :orders %> <%= f.label "1...N的数字" %>
    </p>

    <p>
      <%= f.label :status,"状态" %><br />
      <%=radio_button_tag "resource[status]", "1",true%>是
      <%=radio_button_tag "resource[status]", "0",false%>否
    </p>

    <p>
      <%= f.label :col_id,"所属频道--栏目" %><br />
      <%= select("channel", "id", Channel.find(:all).collect{|i| [ i.name,i.id]},
        { :selected => get_channel(@resource) },
        { "onclick" => remote_function(
            :with => "'channel_id='+value",
            :update => 'next_select',
            :url => { :action => :select_col_with_ajax } ) })%>
      <span id='next_select'>
        <%= render :partial => 'choose_col' %>
      </span>
    </p>

    <p>
      <%= f.label :res_type,"资源类型" %><br />
  <%# f.text_field :res_type %>
      <%=radio_button_tag "resource[res_type]", "1",true%>图集
      <%=radio_button_tag "resource[res_type]", "2",false%>图文
      <%=radio_button_tag "resource[res_type]", "3",false%>小说
    </p>

    <p>
      <%= f.label "标签" %><br />
      <input type="text" name="tags" size="20" value="<%= @tags   %>" />
    </p>

    <p>
      <%= f.label :desc,"描述" %><br />
      <%= f.text_area :desc, :cols => 35, :rows => 8 %>
    </p>

    <p>
      <%= f.submit '确定' %>       &nbsp;&nbsp;&nbsp;&nbsp;<%= link_to '返回列表', url_for(:back) %>
    </p>
  <% end %>